package vip.xiaonuo.biz.modular.simple.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import vip.xiaonuo.biz.modular.org.entity.BizOrg;
import vip.xiaonuo.biz.modular.user.entity.BizUser;
import vip.xiaonuo.common.pojo.CommonEntity;

import java.util.Date;


/**
 * 简单业务实体
 *
 * @author albed
 * @date  2022/12/03 21:20
 **/
@Getter
@Setter
@TableName(value ="BIZ_SIMPLE", autoResultMap = true)
public class BizSimple extends CommonEntity implements TransPojo {

    /** 主键 */
    @TableId
    @ApiModelProperty(value = "主键", position = 1)
    private String id;

    /** 名称 */
    @ApiModelProperty(value = "名称", position = 2)
    private String name;

    /** 编码 */
    @ApiModelProperty(value = "编码", position = 3)
    private String code;

    /** 状态 */
    @ApiModelProperty(value = "状态", position = 4)
    private Integer state;

    /** 类型 */
    @ApiModelProperty(value = "类型", position = 5)
    @Trans(type = TransType.DICTIONARY, key = "BIZ_TYPE")
    private String type;


    /** 所属组织 */
    @ApiModelProperty(value = "所属组织", position = 6)
    @Trans(type = TransType.SIMPLE, target = BizOrg.class, fields = "name", alias = "org", ref = "orgName")
    private String orgId;

    /** 负责人 */
    @ApiModelProperty(value = "负责人", position = 7)
    @Trans(type = TransType.SIMPLE, target = BizUser.class, fields = "name", alias = "user", ref = "ponPerName")
    private String ponPer;

    /** 相关人 */
    @ApiModelProperty(value = "相关人", position = 8)
    private String relPer;

    /** 附件 */
    @ApiModelProperty(value = "附件", position = 9)
    private String enclosure;

    /** 附件2 */
    @ApiModelProperty(value = "附件2", position = 10)
    private String enclosure2;

    /** 备注 */
    @ApiModelProperty(value = "备注", position = 11)
    private String remark;





    @ApiModelProperty(value = "机构名称", position = 12)
    @TableField(exist = false)
    private String orgName;

    @ApiModelProperty(value = "负责人姓名", position = 13)
    @TableField(exist = false)
    private String ponPerName;

//    /** 删除标识 */
//    @ApiModelProperty(value = "删除标识", position = 12)
//    private String deleteFlag;
//
//    /** 创建时间 */
//    @ApiModelProperty(value = "创建时间", position = 13)
//    @TableField(fill = FieldFill.INSERT)
//    // 将字符串转化成时间（一般用于接收前端参数）
//    @DateTimeFormat(pattern = "yyyy-MM-dd")
//    // 将时间date转化成对应格式的字符串（一般用于返回参数）
//    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
//    private Date createTime;

//    /** 创建用户 */
//    @ApiModelProperty(value = "创建用户", position = 14)
//    @TableField(fill = FieldFill.INSERT)
//    private String createUser;
//
//    /** 修改时间 */
//    @ApiModelProperty(value = "修改时间", position = 15)
//    @TableField(fill = FieldFill.UPDATE)
//    private Date updateTime;
//
//    /** 修改用户 */
//    @ApiModelProperty(value = "修改用户", position = 16)
//    @TableField(fill = FieldFill.UPDATE)
//    private String updateUser;
}
